<?php
//
// This file initializes sessions upon first visit to the site.
//
session_start();
if($_SESSION['expires'] < time())
{
	// close out idle sessions
	$_SESSION['user_login']=0;
	$_SESSION['user_name']="";
	$_SESSION['user_id']=0;
	$_SESSION['cleared']=0;
	$_SESSION['user_isadmin']=0;
	$_SESSION['expires']=0;
	$_SESSION['realname']="";
} else {
	// renew expiry timer to 30 minutes
	$_SESSION['expires'] = time() + 1800;
}
if(!isset($_SESSION['expires']))
	$_SESSION['expires']= time() + 1800;
if(!isset($_SESSION['user_login']))
	$_SESSION['user_login']=0;
if(!isset($_SESSION['user_id']))
	$_SESSION['user_id']=0;
if(!isset($_SESSION['user_isadmin']))
	$_SESSION['user_isadmin']=0;
if(!isset($_SESSION['user_name']))
	$_SESSION['user_name']="";
if(!isset($_SESSION['realname']))
	$_SESSION['realname']="";
?>